#!/bin/bash

if [ $# = 0 ] ; then
	echo "Usage: $0 id [id2...]"
	echo "       $0 -s search-string"
	echo " Removes 'id' articles"
	echo " or removes (interactively) by search-string"
	exit 2
fi

table=/srv/http/a/table
remove_by_id ()
{
	sed -i -e "/^$1/d" $table
}

echo -n "Removing entry: "
egrep "^$1" $table || ( echo " entry "$1" not found!" ; exit 1 )
remove_by_id $1
